package jiekou;

import java.util.ArrayList;

public class fangan1 implements Studentjiekou{
    @Override
    public void test1(ArrayList<Students> students) {
        System.out.println("------学生的全部信息-------------");
        for (int i = 0; i < students.size(); i++) {
            System.out.println("姓名："+students.get(i).getName()+"性别"+students.get(i).getSex()+"成绩"+students.get(i).getScore());
        }
        System.out.println("-----------------------------------");
    }
    @Override
    public void test2(ArrayList<Students> students) {
        double sum=0.0 ;
        for (int i = 0; i < students.size(); i++) {
            sum +=students.get(i).getScore();
        }
        System.out.println("学生的平均成绩是："+sum/students.size());

    }
}
